package com.yuantu.judiciary.dao;

import com.yuantu.judiciary.model.domain.OrganizationSourceDO;
import com.yuantu.judiciary.model.domain.SysPlatformOperateLogDO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * 动态信息
 *
 * @author syw
 * @since 2023-08-21
 **/
public interface ISysPlatformOperateLogDao extends JpaRepository<SysPlatformOperateLogDO, Long> {


    @Query("select l from SysPlatformOperateLogDO l left join AccountDO a on l.operatorId = a.id where 1 = 1 " +
            "and (:param is null or :param = '' or (a.username like concat('%',:param,'%') " +
            "or l.operatorIp like concat('%',:param,'%') or l.description like concat('%',:param,'%'))) ")
    Page<SysPlatformOperateLogDO> findInfosByParam(String param, Pageable pageable);
}
